﻿using System;
using System.Collections.Generic;
using innovations.util.collections;

namespace innovations.ml.core.collections
{
    public sealed class ActivationValuesStack<T> : LimitedCapacityCollection<T>
    {
        private ActivationValuesStack() : base() { }

        public static ActivationValuesStack<T> GetInstance(int capacity)
        {
            Capacity = capacity;
            return instance;
        }

        public void Push(T item)
        {
            base.Insert(base.Count, item);
        }

        public T Pop()
        {
            T item = base.Items[base.Count - 1];
            base.RemoveAt(base.Count - 1);
            return item;
        }

        public T Peek()
        {
            return base.Items[base.Count - 1];
        }

        /*
        public new int Count
        {
            get { return base.Count; }
        }
        */
        private static readonly ActivationValuesStack<T> instance = new ActivationValuesStack<T>();
    }
}
